<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>ECharts</title>
    <style>
        #main{
            width: 90vw;
            height: 90vh;
            margin: 0 auto;
        }
    </style>
</head>
<!--变化趋势，折线-->
<body>
<div id="main"></div>
</body>
</html>
<script src="/js/echarts.min.js"></script>
<script type="text/javascript">
    let myChart = echarts.init(document.getElementById('main'));

    let icon3 = 'image://';
    let icon2 = 'image://'
    let icon1 = 'image://'
    let icon4 = 'image://'
    let myColor = ['#48a6d9', '#f25e7a', '#57bbca', '#566d86', '#48a6d9', '#f25e7a', '#57bbca', '#566d86', ];
    let option = {
        backgroundColor: '#fff',
        tooltip: {
            show: false
        },
        grid: {
            top: '20%',
            left: '5%',
            right: '5%',
            bottom: '15%',
        },
        xAxis: {
            data: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'],
            // offset: 15,
            axisLine: {
                lineStyle: {
                    color: '#3b5872',
                    width: '5',
                }
            },
            axisTick: {
                alignWithLabel: true
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#ccc'
                }
            },
            axisLabel: {
                textStyle: {
                    fontSize: 20,
                    fontWeight: '600',
                    color: function(param, index) {
                        return myColor[index]
                    },
                }
            },
        },
        yAxis: {
            min: 0,
            max: 80,
            splitLine: {
                lineStyle: {
                    color: '#ccc'
                }
            },
            axisTick: {
                lineStyle: {
                    color: '#ccc',
                }
            },
            axisLine: {
                lineStyle: {
                    color: '#ccc',
                }
            },
            axisLabel: {
                show: true,
                textStyle: {
                    color: '#ccc',
                }
            },
        },
        series: [{
            type: 'bar',
            z: 1,
            itemStyle: {
                color: {
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0,
                        color: 'rgba(219, 219, 219,1)'
                    }, {
                        offset: .3,
                        color: 'rgba(219, 219, 219,.3)'
                    }, {
                        offset: 1,
                        color: 'rgba(219, 219, 219,.1)'
                    }],
                    global: false
                },
            },
            barWidth: '40',
            data: [43, 40, 60, 50, 60, 40, 50, 60],
        },
            {
                name: '',
                type: "effectScatter",
                rippleEffect: {
                    period: 1,
                    scale: 2,
                    brushType: 'fill'
                },
                z: 2,
                symbolPosition: 'end',
                symbolSize: 40.6,
                symbolOffset: ['0', '0'],
                itemStyle: {
                    normal: {
                        shadowColor: 'rgba(0, 0, 0, .3)',
                        shadowBlur: 5,
                        shadowOffsetY: 3,
                        shadowOffsetX: 0,
                        color: function(params) {
                            let colorList = ['#57bbca', '#f25e7a', '#48a6d9', '#566d86', '#57bbca', '#f25e7a', '#48a6d9', '#566d86', ];
                            return colorList[params.dataIndex]
                        },
                        label: {
                            show: true,
                            fontSize: 24,
                            position: 'top',
                            distance: -80,
                            formatter: '{c}',
                            fontWeight: '600',
                        }
                    }
                },
                data: [{
                    value: 43,
                    symbol: icon1,
                }, {
                    value: 40,
                    symbol: icon2,
                }, {
                    value: 60,
                    symbol: icon3,
                }, {
                    value: 50,
                    symbol: icon4,
                }, {
                    value: 60,
                    symbol: icon1,
                }, {
                    value: 40,
                    symbol: icon2,
                }, {
                    value: 50,
                    symbol: icon3,
                }, {
                    value: 60,
                    symbol: icon4,
                }]
            },
            {
                name: 'A',
                type: 'line',
                z: 1,
                // symbol: 'roundRect',
                lineStyle: {
                    normal: {
                        width: 2,
                        color: '#000',
                    }
                },
                symbolSize: [0, 0],
                data: [43, 40, 60, 50, 60, 40, 50, 60],
            },

        ],
    };
    myChart.setOption(option);
</script>
